home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 5_programming / on / dcc_raw < prev    next >
Encoding:
Text File  |  2001-03-21  |  1.2 KB  |  33 lines

  1. Synopsis:
  2.    on [<modes>]dcc_raw [<serial#>] [-|^]<match> { <action> }
  3.  
  4. Description:
  5.    This hook is triggered whenever the client receives a raw message about
  6.    a tcp connection established, or a connection attempt, with $connect().
  7.    Raw messages are sent across established tcp connections with DCC RAW.
  8.  
  9.    Scripts that use sockets should always set a non-zero serial number for
  10.    it.  Otherwise, it is very easy to set confusing or conflicting hooks.
  11.    Each specific instance of a socket application should use a separate
  12.    serial number, to prevent conflicts.
  13.  
  14. Parameters:
  15.    $0    file descriptor for connection (returned by $connect())
  16.    $1    host connected to (hostname or ip address)
  17.    $2    code for connection type:
  18.            c - socket was closed
  19.            d - incoming data
  20.            e - issued when $connect() returns successfully
  21.            n - connection accepted on a port the client is listening to
  22.    $3-   data for type 'd', port number for types 'e' and 'n', none for 'c'
  23.            
  24. Examples:
  25.    To display all successful socket connections:
  26.       on #-dcc_raw 10 "% % e %" {
  27.          echo *** Connection with $1 on port $3 \(fd: $0\)
  28.       }
  29.  
  30. See Also:
  31.    connect(6); dcc(1) raw; listen(6)
  32.  
  33.